import { http } from '@/utils/request'
import type { EditUser, User, UserInfo } from '@/types/user'
// 获取个人自己的信息
export const getUserApi = () => http<User>('/user', 'get')
// 获取用户个人资料
export const getUserInfoApi = () => http<UserInfo>('/user/profile', 'get')
// 编辑用户资料
export const editProfileApi = (data: EditUser) => http<User & { birthday: string }>('/user/profile', 'patch', data)
// 上传头像
export const uploadAvatarApi = (data: FormData) => http<{
  id: string
  photo: string
}>('/user/photo', 'PATCH', data)
